package ink.xiaobaibai.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import ink.xiaobaibai.bo.SelectMonDeviceBo;
import ink.xiaobaibai.entity.MonthlyfeeDevice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author xiaobaibai
 * @since 2021-05-30
 */
public interface MonthlyfeeDeviceDao extends BaseMapper<MonthlyfeeDevice> {

    public List<MonthlyfeeDevice> getDeviceList(@Param("selectMonDeviceBo") SelectMonDeviceBo selectMonDeviceBo);

    public Integer getCountByDeviceList(@Param("selectMonDeviceBo") SelectMonDeviceBo selectMonDeviceBo);

    @Select("SELECT device_code FROM monthly_oxygen_device WHERE id = (SELECT oxygen_id FROM monthlyfee_device WHERE device_code = #{deviceCode})")
    public String getOxygenCodeByDeviceCode(@Param("deviceCode") String deviceCode);

}
